import request from '@/utils/request'

/**
 * 工务目标设定
 */
export function page(query) {
  return request({
    url: '/api/admin/worksTarget/page',
    method: 'get',
    params: query
  })
}

// 国别、bg、bu三级联动
export function getBuAndBg(country, bg, bu) {
  return request({
    url: bu ? '/api/admin/worksTarget/getBuAndBg?bg=' + bg + '&country=' + country + '&bu=' + bu : '/api/admin/worksTarget/getBuAndBg?bg=' + bg + '&country=' + country,
    method: 'get'
  })
}

// 新增工务目标
export function getBusinessTarget(list) {
  return request({
    url: '/api/admin/worksTarget/getBusinessTarget',
    method: 'post',
    data: list
  })
}

// 查看公务目标
export function getTargetDetail(id) {
  return request({
    url: '/api/admin/worksTargetDetail/getTargetDetail/' + id,
    method: 'get'
  })
}

// 修改公务目标
export function savaListTargetDetail(list) {
  return request({
    url: '/api/admin/worksTargetDetail/savaListTargetDetail',
    method: 'post',
    data: list
  })
}

// 删除
export function deleteList(list) {
  return request({
    url: '/api/admin/worksTarget/deleteList',
    method: 'delete',
    data: list
  })
}

// 删除
export function deleteListDetail(list) {
  return request({
    url: '/api/admin/worksTargetDetail/deleteList',
    method: 'delete',
    data: list
  })
}


// HQ国别占比分摊
export function countrySetting(list) {
  return request({
    url: '/api/admin/hqShare/countryShareSetting',
    method: 'post',
    data: list
  })
}

// 查看初始版本
export function getInitialVersion(name) {
  return request({
    url: '/api/admin/worksTarget/getInitialVersion?name=' + name,
    method: 'get'
  })
}

// HQ占比设置
export function getByHq() {
  return request({
    url: '/api/admin/hqRation/getByHq',
    method: 'get'
  })
}









